# Maintainer: Maxime Gauduin <alucryd@archlinux.org>
export CHECKFUNC=1

pkgname=hypercorn
pkgver=0.14.3
pkgrel=2
pkgdesc='An ASGI Server based on Hyper libraries and inspired by Gunicorn'
url=https://github.com/pgjones/hypercorn
arch=(any)
license=(MIT)
depends=(
  python-h11
  python-h2
  python-priority
  python-toml
  python-typing_extensions
  python-wsproto
)
makedepends=(
  git
  python-build
  python-installer
  python-poetry-core
)
checkdepends=(
  python-distlib
  python-hypothesis
  python-pytest
  python-pytest-asyncio
  python-pytest-sugar
  python-pytest-trio
  python-tox
  python-trio
)
optdepends=('python-trio: trio support')
_tag=8c3fc86e7f48285d69b2f3ddc676b108d78d3f6e
source=(git+https://github.com/pgjones/hypercorn.git#tag=${_tag})
sha256sums=(SKIP)

pkgver() {
  cd hypercorn
  git describe --tags
}

build() {
  cd hypercorn
  python -m build --wheel --no-isolation
}

check() {
  cd hypercorn
  tox -e py311
}

package() {
  python -m installer --destdir="${pkgdir}" hypercorn/dist/*.whl
  install -Dm 644 hypercorn/LICENSE -t "${pkgdir}"/usr/share/licenses/hypercorn/
}

# vim: ts=2 sw=2 et:
